package com.example.myapplication;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

//数据库模型，设置电影信息
@Entity
public  class Movie {
    @PrimaryKey(autoGenerate = true)
    public int id;
    @ColumnInfo(name = "name")
    public String name;
    @ColumnInfo(name = "poster_path")
    public int posterPath; // 海报路径 (现在是 drawable 资源 ID)

    // 添加一个空的构造函数
    public Movie() {
    }

    // 添加一个参数匹配的构造函数
    public Movie(String name, int posterPath) {
        this.name = name;
        this.posterPath = posterPath;
    }

    // getter 和 setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPosterPath() {
        return posterPath;
    }

    public void setPosterPath(int posterPath) {
        this.posterPath = posterPath;
    }
}
